﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LibraryO2S;

public partial class Administrator_CustomerPaging : System.Web.UI.Page
{
    private CustomerController objCustomer = new CustomerController();
    TownController controller = new TownController();
    BindToControls control = new BindToControls();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindData();

        }
    }

    private void bindData()
    {
        try
        {
            //DropDownList1.DataSource = controller.GetAll();
            ////ddgender.DataBind();
            //control.BinDDL(DropDownList1, controller.GetAll(), "TOWNNAME", "TOWN_ID");
            //CollectionPager1.DataSource = objCustomer.GetAll().DefaultView;
            //CollectionPager1.BindToControl = rptData;
            //CollectionPager1.PageSize = 20;
            //CollectionPager1.DataBind();

            //rptData.DataSource = CollectionPager1.DataSourcePaged;
            //rptData.DataBind();
            //if (rptData.Items.Count == 0)
            //{
            //    divMessage.InnerHtml = O2S_Message.Warning("Cảnh Báo", "Chưa Có dữ liệu trong mục này!");
            //}
            //else
            //{
            //    divMessage.InnerHtml = "";
            //}
        }
        catch
        {
            divMessage.InnerHtml = O2S_Message.Warning("Cảnh Báo", "Chưa Có dữ liệu trong mục này!");
        }
    }


    protected void btnDelete_Click(object sender, EventArgs e)
    {
        try
        {

            string del_list = hdfCheck.Value;
            string[] sp_list = del_list.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < sp_list.Length; i++)
            {

           //     objCustomer.tblC(int.Parse(sp_list[i]));
            }
            //LoadData();
        }
        catch (Exception ex)
        {

            divMessage.InnerHtml = O2S_Message.Error("Cảnh Báo", "Phát hiện lỗi! " + ex.Message);
        }
    }
}